package com.itttq.sc.bw.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.itttq.sc.bw.service.IRiverService;
import com.itttq.sc.po.RiverPo;

@RestController
public class RiverController {
	@Autowired
	IRiverService riverService;
	
	@RequestMapping("/{id}")
	public RiverPo getRiverById(@PathVariable("id") int id) {
		return riverService.getRiverById(id);
	}

	@RequestMapping(value = "/rivers")
	public List<RiverPo> getRivers(RiverPo river) {
		return riverService.getRivers(river);
	}

	@RequestMapping(value = "/save")
	public void saveRiver(RiverPo river) {
		riverService.saveRiver(river);
	}

	@RequestMapping(value = "/del/{id}")
	public void delRiver(@PathVariable("id") int id) {
		riverService.delRiver(id);
	}
}
